<template>
  <view class="work-container">
    <!-- 宫格组件 -->
    <view style="display: flex; height: 40px; margin-top: 20px">
      <view style="height: 100%; width: 8px; background-color: #4c9d44"></view>
      <view
	   v-if="checkBug003()"
        style="
          height: 100%;
          line-height: 40px;
          margin-left: 20px;
          color: black;
          font-size: 18px;
          font-weight: 500;
        "
        >工作台</view
      >
    </view>

    <view class="grid-body">
      <uni-grid :column="3" :showBorder="false" @change="changeGrid">
        <uni-grid-item :index="0">
          <view class="grid-item-box">
            <uni-icons type="person-filled" size="35"></uni-icons>
            <text class="text">个人工资</text>
          </view>
        </uni-grid-item>
        <uni-grid-item :index="1">
          <view class="grid-item-box">
            <uni-icons type="staff-filled" size="30"></uni-icons>
            <text class="text">年度收入汇总</text>
          </view>
        </uni-grid-item>
        <uni-grid-item :index="2">
          <view class="grid-item-box">
            <uni-icons type="color" size="35"></uni-icons>
            <text class="text">我的合同</text>
          </view>
        </uni-grid-item>
        <uni-grid-item :index="3">
          <view class="grid-item-box">
            <uni-icons type="settings-filled" size="35"></uni-icons>
            <text class="text">我的证书</text>
          </view>
        </uni-grid-item>
        <uni-grid-item :index="4">
          <view class="grid-item-box">
            <uni-icons type="heart-filled" size="35"></uni-icons>
            <text class="text">培训进修</text>
          </view>
        </uni-grid-item>
        <uni-grid-item :index="5">
          <view class="grid-item-box">
            <uni-icons type="bars" size="35"></uni-icons>
            <text class="text">奖励记录</text>
          </view>
        </uni-grid-item>
        <uni-grid-item :index="6">
          <view class="grid-item-box">
            <uni-icons type="staff-filled" size="30"></uni-icons>
            <text class="text">惩罚记录</text>
          </view>
        </uni-grid-item>
        <uni-grid-item :index="7">
          <view class="grid-item-box">
            <uni-icons type="gear-filled" size="35"></uni-icons>
            <text class="text">个人考评</text>
          </view>
        </uni-grid-item>
      </uni-grid>
    </view>
  </view>
</template>

<script>
	import isHaveBug from '@/utils/bug'
export default {
  data() {
    return {
      current: 0,
      swiperDotIndex: 0,
    };
  },
  methods: {
	  checkBug003(){
		 
		return !isHaveBug("HR-APP-003")  
	  },
    clickBannerItem(item) {
      console.info(item);
    },
    changeSwiper(e) {
      this.current = e.detail.current;
    },
    changeGrid(e) {
      // this.$modal.showToast("模块建设中~");

      let index = e.detail.index;
      let url;
      if (index == 0) {
        url = "work/salary/salary";
      } else if (index == 1) {
        url = "work/earning/earning";
      } else if (index == 2) {
        url = "work/contract/contract";
      } else if (index == 3) {
        url = "work/certificate/certificate";
      } else if (index == 4) {
        url = "work/train/train";
      } else if (index == 5) {
        url = "work/incentive/incentive";
      } else if (index == 6) {
        url = "work/punish/punish";
      } else {
        url = "work/appraisal/appraisal";
      }
      uni.navigateTo({
        url: url,
      });
    },
  },
};
</script>

<style lang="scss">
/* #ifndef APP-NVUE */
page {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background-color: #fafafa;
  min-height: 100%;
  height: auto;
}

view {
  font-size: 14px;
  line-height: inherit;
}

/* #endif */

.text {
  text-align: center;
  font-size: 26rpx;
  margin-top: 10rpx;
}

.grid-item-box {
  flex: 1;
  /* #ifndef APP-NVUE */
  display: flex;
  /* #endif */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px 0;
  margin: 20px;
  border-radius: 10px;
  background-color: white;
  box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.05);
  font-size: 16px;
  font-weight: 500;
}

.uni-margin-wrap {
  width: 690rpx;
  width: 100%;
}

.swiper {
  height: 300rpx;
}

.swiper-box {
  height: 150px;
}

.swiper-item {
  /* #ifndef APP-NVUE */
  display: flex;
  /* #endif */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #fff;
  height: 300rpx;
  line-height: 300rpx;
}

@media screen and (min-width: 500px) {
  .uni-swiper-dot-box {
    width: 400px;
    /* #ifndef APP-NVUE */
    margin: 0 auto;
    /* #endif */
    margin-top: 8px;
  }

  .image {
    width: 100%;
  }
}
</style>
